void swap(int* i, int *j)
{
	int tmp = *i;
	*i = *j;
	*j = tmp;
}

void quickSort(int* begin, int* end)
{
	int middle = *(begin+(end-begin)/2);
	int* i = begin;
	int* j = end;

	do{
		while(*i < middle) i++;
		while(*j > middle) j--;

		if(i<=j){
			swap(i,j);
			i++; j--;
		}
	}while(i<=j);

	if(i<end)
		quickSort(i, end);
	if(j>begin)
		quickSort(begin, j);
}
